package com.hnhcyy.goods.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.data.elasticsearch.core.query.IndexQuery;
import org.springframework.data.elasticsearch.core.query.IndexQueryBuilder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hnhcyy.goods.mapper.SpkfkOperateLogMapper;
import com.hnhcyy.goods.pojo.SpkfkOperateLog;
import com.hnhcyy.goods.pojo.Goods;
import com.hnhcyy.goods.pojo.GoodsPre;
import com.hnhcyy.goods.properties.ImageConfig;

@RestController
//@RequestMapping("/help")
public class HelpApi {

	@Autowired SpkfkOperateLogMapper spkfkOperateLogMapper;

	@RequestMapping("/readme")
	public String readme() {
		return "this is hcyy goods api.";
	}

	@RequestMapping("/test1")
	public String test1() {
		GoodsPre goodsPre = new GoodsPre();
		goodsPre.setSpid("SPH00000001");
		String pic = goodsPre.getMinPicture();
		//		System.out.println(ImageConfig.goodsPicturePrefix);
		return "picture is:" + pic;
	}

	@RequestMapping("/test2")
	public String test2() {
		SpkfkOperateLog item= spkfkOperateLogMapper.select("20181212142501001");
		System.out.println("select return:"+item.getOperateTime());
		return item.getId();
	}

}
